package com.aya.base.job.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 * jdbc 相关配置
 * 
 * @author platform
 *
 */
@Service
public class JdbcConfig {
    @Value(value = "${jdbc.url}")
    private String url;
    @Value(value = "${jdbc.driver}")
    private String driver;
    @Value(value = "${jdbc.username}")
    private String username;
    @Value(value = "${jdbc.password}")
    private String password;
    @Value(value = "${dataSource.initialSize}")
    private int initialSize;
    @Value(value = "${dataSource.maxIdle}")
    private int maxIdle;
    @Value(value = "${dataSource.minIdle}")
    private int minIdle;
    @Value(value = "${dataSource.maxActive}")
    private int maxActive;
    @Value(value = "${dataSource.logAbandoned}")
    private boolean logAbandoned;
    @Value(value = "${dataSource.removeAbandoned}")
    private boolean removeAbandoned;
    @Value(value = "${dataSource.removeAbandonedTimeout}")
    private int removeAbandonedTimeout;
    @Value(value = "${dataSource.maxWait}")
    private int maxWait;

    /**
     * @return jdbc url
     */
    public String getUrl() {
        return url;
    }

    /**
     * @return jdbc driver
     */

    public String getDriver() {
        return driver;
    }

    /**
     * @return db username
     */

    public String getUsername() {
        return username;
    }

    /**
     * @return db password
     */
    public String getPassword() {
        return password;
    }

    /**
     * @return datasource initial size
     */

    public int getInitialSize() {
        return initialSize;
    }

    /**
     * @return datasource max idle
     */

    public int getMaxIdle() {
        return maxIdle;
    }

    /**
     * @return datasource min idle
     */

    public int getMinIdle() {
        return minIdle;
    }

    /**
     * @return datasource max active
     */

    public int getMaxActive() {
        return maxActive;
    }

    /**
     * @return datasource log abandoned
     */

    public boolean isLogAbandoned() {
        return logAbandoned;
    }

    /**
     * @return datasource remove abanoned
     */

    public boolean isRemoveAbandoned() {
        return removeAbandoned;
    }

    /**
     * @return datasource remove abandoned timeout
     */

    public int getRemoveAbandonedTimeout() {
        return removeAbandonedTimeout;
    }

    /**
     * @return datasource max waite
     */

    public int getMaxWait() {
        return maxWait;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public void setDriver(String driver) {
        this.driver = driver;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setInitialSize(int initialSize) {
        this.initialSize = initialSize;
    }

    public void setMaxIdle(int maxIdle) {
        this.maxIdle = maxIdle;
    }

    public void setMinIdle(int minIdle) {
        this.minIdle = minIdle;
    }

    public void setMaxActive(int maxActive) {
        this.maxActive = maxActive;
    }

    public void setLogAbandoned(boolean logAbandoned) {
        this.logAbandoned = logAbandoned;
    }

    public void setRemoveAbandoned(boolean removeAbandoned) {
        this.removeAbandoned = removeAbandoned;
    }

    public void setRemoveAbandonedTimeout(int removeAbandonedTimeout) {
        this.removeAbandonedTimeout = removeAbandonedTimeout;
    }

    public void setMaxWait(int maxWait) {
        this.maxWait = maxWait;
    }
}
